//
//  Floating.h
//  Floating Window
//
//  Created by 吴浪 on 15/8/24.
//  Copyright (c) 2015年 浪遥. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

/** 触摸事件类型 */
typedef NS_ENUM(NSInteger, FloatingTouchType) {
    FloatingTouchTypeOneClick = 0, //单击
    FloatingTouchTypeTwoClick, //双击
    FloatingTouchTypeLongPress, //长按
};


@protocol FloatingDelegate;
@interface Floating : UIWindow
@property (nonatomic, strong) NSString *imageName; /**< 悬浮窗图标 */
@property (nonatomic, strong) UIView *contentView; /**< 弹出视图 */
@property (nonatomic, assign) FloatingTouchType contentViewTouchType; /**< 弹出视图对应触摸事件类型，默认=FloatingTouchTypeOneClick */
@property(nonatomic, assign, getter=isDragEnable) BOOL dragEnable; /**< 是否可拖拽,默认=YES(可以拖拽) */

@property (nonatomic, weak) id <FloatingDelegate> floatingDelegate;

/** 初始化悬浮窗 */
+ (instancetype)floatingWithFrame:(CGRect)frame imageName:(NSString *)imageName delegate:(id)delegate;
- (instancetype)initWithFrame:(CGRect)frame imageName:(NSString *)imageName delegate:(id)delegate;;
@end

@protocol FloatingDelegate <NSObject>

@optional
/** 悬浮窗触摸事件响应 */
- (void)floatingDidClick:(Floating *)floating type:(FloatingTouchType)type;
@end